package com.xin.beauty.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xin.beauty.pojo.entity.Admin;
import com.xin.beauty.pojo.entity.User;
import com.xin.beauty.pojo.query.AdminQuery;
import com.xin.beauty.pojo.query.UserQuery;
import com.xin.beauty.service.IAdminService;
import com.xin.beauty.service.IUserService;
import com.xin.beauty.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Xin
 * @since 2025-05-03
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @GetMapping("/list")
    //@RequestMapping(value = "/list", method = {RequestMethod.GET})
    //@RequestMapping(value = "/list", method = {RequestMethod.GET, RequestMethod.POST})
    public Result list(UserQuery userQuery) {
        System.out.println("AdminController.list");
        IPage<User> page = userService.list(userQuery);
        return Result.ok(page);
    }
}

